<!-- 单选框 -->
<template>
  <div class="radio-container">
    <div class="item" :class="{selected: props.selected === 1}" @click="headleRadio(1)">完成</div>
    <div class="item" :class="{selected: props.selected === 2}" @click="headleRadio(2)">未完成</div>
  </div>
</template>

<script setup>
const props = defineProps({
  selected: {
    type: Number,
    default: 1,
  }
});
const emit = defineEmits(["headleRadio"])
const headleRadio = (value) => {
    emit("headleRadio",value)
}
</script>

<style lang="less" scoped>
@import "@/styles/var.less";
.radio-container {
  width: 100%;
    display: flex;
  
  .item {
    width: 90px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    font-size: 1em;
    color:#000;
    border: 1px solid #000;
    cursor: pointer;
    background-color: #fff;
    &.selected {
        border-color: @frameColor1;
        background-color: @frameColor1;
        color: #fff;
    }
    
  }
  .item:first-child{
        border-radius: 5px 0 0 5px;
        
    }
    .item:last-child{
        border-radius: 0px 5px 5px 0px;
    }
}
</style>